using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class SO_ADMISIONDentMap : EntityTypeConfiguration<SO_ADMISIONDent>
    {
        public SO_ADMISIONDentMap()
        {
            // Primary Key
            this.HasKey(t => new { t.Status, t.Latin_Last_Name, t.IID, t.ENTRY_DATE, t.PATIENT_PRICE_LIST, t.SumFields, t.DimFields });

            // Properties
            this.Property(t => t.Status)
                .IsRequired()
                .HasMaxLength(9);

            this.Property(t => t.id)
                .HasMaxLength(10);

            this.Property(t => t.Episode)
                .HasMaxLength(50);

            this.Property(t => t.CASE__)
                .HasMaxLength(15);

            this.Property(t => t.Latin_Name)
                .HasMaxLength(30);

            this.Property(t => t.Arabic_Name)
                .HasMaxLength(40);

            this.Property(t => t.Latin_Last_Name)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.IID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.PATIENT_ID)
                .HasMaxLength(6);

            this.Property(t => t.Attending_PHYSICIAN)
                .HasMaxLength(50);

            this.Property(t => t.TYPE)
                .HasMaxLength(11);

            this.Property(t => t.Department)
                .HasMaxLength(50);

            this.Property(t => t.ENTRY_TYPE)
                .HasMaxLength(25);

            this.Property(t => t.PATIENT_STATUS)
                .HasMaxLength(11);

            this.Property(t => t.PATIENT_PRICE_LIST)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.GUARANTOR_1)
                .HasMaxLength(60);

            this.Property(t => t.GUARANTOR_2)
                .HasMaxLength(60);

            this.Property(t => t.FACILITY)
                .HasMaxLength(20);

            this.Property(t => t.FACILITYID)
                .HasMaxLength(8000);

            this.Property(t => t.WARD)
                .HasMaxLength(20);

            this.Property(t => t.REFERRAL_PHYSICIAN)
                .HasMaxLength(41);

            this.Property(t => t.REFERRAL_ID)
                .HasMaxLength(10);

            this.Property(t => t.Attending_ID)
                .HasMaxLength(6);

            this.Property(t => t.PATIENT_CLASS)
                .HasMaxLength(50);

            this.Property(t => t.GUARANTOR_1_CLASS)
                .HasMaxLength(10);

            this.Property(t => t.GUARANTOR_2_CLASS)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.GUARANTOR_1_CONTRACT)
                .HasMaxLength(50);

            this.Property(t => t.GUARANTOR_2_CONTRACT)
                .HasMaxLength(50);

            this.Property(t => t.VISA_)
                .HasMaxLength(20);

            this.Property(t => t.CARD__)
                .HasMaxLength(50);

            this.Property(t => t.Month)
                .HasMaxLength(2);

            this.Property(t => t.Year)
                .HasMaxLength(4);

            this.Property(t => t.SumFields)
                .IsRequired()
                .HasMaxLength(6);

            this.Property(t => t.DimFields)
                .IsRequired()
                .HasMaxLength(43);

            // Table & Column Mappings
            this.ToTable("SO_ADMISIONDent");
            this.Property(t => t.Status).HasColumnName("Status");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.Episode).HasColumnName("Episode");
            this.Property(t => t.CASE__).HasColumnName("CASE_#");
            this.Property(t => t.Latin_Name).HasColumnName("Latin_Name");
            this.Property(t => t.Arabic_Name).HasColumnName("Arabic_Name");
            this.Property(t => t.Latin_Last_Name).HasColumnName("Latin_Last_Name");
            this.Property(t => t.IID).HasColumnName("IID");
            this.Property(t => t.PATIENT_ID).HasColumnName("PATIENT_ID");
            this.Property(t => t.Attending_PHYSICIAN).HasColumnName("Attending_PHYSICIAN");
            this.Property(t => t.TYPE).HasColumnName("TYPE");
            this.Property(t => t.ENTRY_DATE).HasColumnName("ENTRY_DATE");
            this.Property(t => t.DISCHARGE_DATE).HasColumnName("DISCHARGE_DATE");
            this.Property(t => t.Department).HasColumnName("Department");
            this.Property(t => t.ENTRY_TYPE).HasColumnName("ENTRY_TYPE");
            this.Property(t => t.PATIENT_STATUS).HasColumnName("PATIENT_STATUS");
            this.Property(t => t.PATIENT_PRICE_LIST).HasColumnName("PATIENT_PRICE_LIST");
            this.Property(t => t.GUARANTOR_1).HasColumnName("GUARANTOR_1");
            this.Property(t => t.GUARANTOR_2).HasColumnName("GUARANTOR_2");
            this.Property(t => t.FACILITY).HasColumnName("FACILITY");
            this.Property(t => t.FACILITYID).HasColumnName("FACILITYID");
            this.Property(t => t.WARD).HasColumnName("WARD");
            this.Property(t => t.REFERRAL_PHYSICIAN).HasColumnName("REFERRAL_PHYSICIAN");
            this.Property(t => t.REFERRAL_ID).HasColumnName("REFERRAL_ID");
            this.Property(t => t.Attending_ID).HasColumnName("Attending_ID");
            this.Property(t => t.PATIENT_CLASS).HasColumnName("PATIENT_CLASS");
            this.Property(t => t.GUARANTOR_1_CLASS).HasColumnName("GUARANTOR_1_CLASS");
            this.Property(t => t.GUARANTOR_2_CLASS).HasColumnName("GUARANTOR_2_CLASS");
            this.Property(t => t.GUARANTOR_1_CONTRACT).HasColumnName("GUARANTOR_1_CONTRACT");
            this.Property(t => t.GUARANTOR_2_CONTRACT).HasColumnName("GUARANTOR_2_CONTRACT");
            this.Property(t => t.VISA_).HasColumnName("VISA#");
            this.Property(t => t.VISA_DATE).HasColumnName("VISA_DATE");
            this.Property(t => t.CARD__).HasColumnName("CARD_#");
            this.Property(t => t.CARD_END_DATE).HasColumnName("CARD_END_DATE");
            this.Property(t => t.CARD_START_DATE).HasColumnName("CARD_START_DATE");
            this.Property(t => t.adnb).HasColumnName("adnb");
            this.Property(t => t.Month).HasColumnName("Month");
            this.Property(t => t.Year).HasColumnName("Year");
            this.Property(t => t.SumFields).HasColumnName("SumFields");
            this.Property(t => t.DimFields).HasColumnName("DimFields");
        }
    }
}
